package com.bank.controller;

import com.bank.domain.Bank;
import com.bank.mapper.BankMapper;
import com.bank.utils.BlogText;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author mtl
 * 2021/6/1
 */
@RestController
@RequestMapping("/bank")
public class bankController{

    @Autowired
    BankMapper bankMapper;


    @GetMapping("/open")
    public void open(){
        int page=1778;
        while (true){
            List<Bank> list = BlogText.Blog(page);
            page++;
            list.forEach(System.out::println);
            bankMapper.batchInsert(list);
        }
    }
}
